/*
 * Sidebar
 */


/* Hide for mobile, show later */

.header {
  background-color: $mainside-bg;
  @media (max-width: $screen-xs-max) {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 1050;
    @include clearfix;
  }
  @media (min-width: $screen-sm-min) {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: block;
    padding: 0;
    // overflow-x: hidden;
    overflow-y: auto;
    /* Scrollable contents if viewport is shorter than content. */
    border-right: 1px solid $sidebar-border-color;
    width: $mainside-sm-width;
  }
  @media (min-width: $screen-md-min) {
    width: $mainside-md-width;
  }
  @media (min-width: $screen-lg-min) {
    width: $mainside-lg-width;
  }
  @media (min-width: $screen-xl-min) {
    width: $mainside-xl-width;
  }
}

.sidebar {
  background-color: $sidebar-bg;
  .slimContent {
    padding: 20px;
  }
  @media (max-width: $screen-xs-max) {
    display: none;
  }
  @media (min-width: $screen-sm-min) {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: block;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    /* Scrollable contents if viewport is shorter than content. */
    border-right: 1px solid $sidebar-border-color;
    width: $sidebar-sm-width;
  }
  @media (min-width: $screen-md-min) {
    width: $sidebar-md-width;
    .slimContent {
      padding-right: 25px;
      padding-left: 25px;
    }
  }
  @media (min-width: $screen-lg-min) {
    width: $sidebar-lg-width;
    .slimContent {
      padding-right: 30px;
      padding-left: 30px;
    }
  }
  @media (min-width: $screen-xl-min) {
    width: $sidebar-xl-width;
    .slimContent {
      padding-right: 40px;
      padding-left: 40px;
    }
  }
}

.main {
  position: relative;
  min-height: 100vh;
  padding: 15px;
  @include clearfix;
  @media (max-width: $screen-xs-max) {
    min-height: auto;
    // overflow-x: hidden;
  }
  @media (min-width: $screen-sm-min) {
    width: $main-sm-width;
    padding-right: 20px;
    padding-left: 20px;
  }
  @media (min-width: $screen-md-min) {
    width: $main-md-width;
    padding-right: 25px;
    padding-left: 25px;
  }
  @media (min-width: $screen-lg-min) {
    width: $main-lg-width;
    padding-right: 30px;
    padding-left: 30px;
  }
  @media (min-width: $screen-xl-min) {
    width: $main-xl-width;
    padding-right: 40px;
    padding-left: 40px;
  }
}

.footer {
  padding: 20px;
  background-color: $mainside-bg;
  @media (min-width: $screen-sm-min) {
    position: fixed;
    bottom: 0;
    margin: 0 auto;
    background-color: transparent;
    color: $link-dark-color;
    z-index: 1050;
    width: $mainside-sm-width;
  }
  @media (min-width: $screen-md-min) {
    width: $mainside-md-width;
  }
  @media (min-width: $screen-lg-min) {
    width: $mainside-lg-width;
  }
  @media (min-width: $screen-xl-min) {
    width: $mainside-xl-width;
  }
}


/*
 * main-center
 */

body.main-center {
  .header {}
  .sidebar {
    left: auto;
    right: 0;
    border-left: 1px solid $sidebar-border-color;
    border-right: 0;
  }
  .main {
    @media (min-width: $screen-sm-min) {
      margin-left: 4.16666667%;
    }
    @media (min-width: $screen-md-min) {
      margin-left: 16.66666667%;
    }
    @media (min-width: $screen-lg-min) {
      margin-left: 16.66666667%;
    }
  }
}


/*
 * main-left
 */

body.main-left {
  .header {
    left: auto;
    right: 0;
    border-left: 1px solid $sidebar-border-color;
    border-right: 0;
  }
  .sidebar {
    left: auto;
    right: 0;
    border-left: 1px solid $sidebar-border-color;
    border-right: 0;
    @media (min-width: $screen-sm-min) {
      margin-right: 4.16666667%;
    }
    @media (min-width: $screen-md-min) {
      margin-right: 16.66666667%;
    }
    @media (min-width: $screen-lg-min) {
      margin-right: 16.66666667%;
    }
  }
}


/*
 * main-right
 */

body.main-right {
  .header {}
  .sidebar {
    @media (min-width: $screen-sm-min) {
      margin-left: 4.16666667%;
    }
    @media (min-width: $screen-md-min) {
      margin-left: 16.66666667%;
    }
    @media (min-width: $screen-lg-min) {
      margin-left: 16.66666667%;
    }
  }
  .main {
    @media (min-width: $screen-sm-min) {
      margin-left: 37.5%;
    }
    @media (min-width: $screen-md-min) {
      margin-left: 41.66666667%;
    }
    @media (min-width: $screen-lg-min) {
      margin-left: 41.66666667%;
    }
  }
}

body.no-sidebar {
  .sidebar {
    display: none!important;
  }
  &.main-left {
    .main {
      @media (min-width: $screen-sm-min) {
        width: 95.83333333%;
        margin-right: 4.16666667%;
      }
      @media (min-width: $screen-md-min) {
        width: 83.33333333%;
        margin-right: 16.66666667%;
      }
      @media (min-width: $screen-lg-min) {
        width: 83.33333333%;
        margin-right: 16.66666667%;
      }
    }
  }
  &.main-right,
  &.main-center {
    .main {
      @media (min-width: $screen-sm-min) {
        width: 95.83333333%;
        margin-left: 4.16666667%;
      }
      @media (min-width: $screen-md-min) {
        width: 83.33333333%;
        margin-left: 16.66666667%;
      }
      @media (min-width: $screen-lg-min) {
        width: 83.33333333%;
        margin-left: 16.66666667%;
      }
    }
  }
}
